<?php $data = APP::$V['photos']; ?>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Comfort - Admin Portal</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <!-- Le styles -->
    <link href="view/css/bootstrap.css" rel="stylesheet">

  </head>
  <body>
    <div class="container">
        <div class="row" style="margin-top: 20px;">
            <div class="subnav subnav-fixed">
                <ul class="nav nav-pills pull-right">
                    <!--<li><a href="#">Export</a></li>-->
                    <li><a href="logout.php">Logout</a></li>
                </ul>
            </div>
        </div>
        <div class="row">
            <div class="span12">
                <table class="table table-bordered table-striped">
                    <thead>
                        <tr>
                            <th>WeiboID</th>
                            <th>PhotoID</th>
							<th>isShared</th>
							<th>isFollowed</th>
							<th>SaveTime</th>
							<th>ShareTime</th>
                        </tr>
                    </thead>
                    <tbody>
						<!--
                        <tr>
                            <td>34532242346</td>
                            <td>4632</td>
							<td>1</td>
                            <td>2012-09-11 12:03:05</td>
                            <td>2012-09-11 12:03:13</td>
                        </tr>
						-->
						<?php
						foreach ($data['photos'] as $photo) {
							echo '<tr>';
							echo "<td><a href='http://weibo.com/{$photo['wb_uid']}' target='_blank'>{$photo['wb_uid']}</a></td>";
							echo "<td><a href='/photo/file/{$photo['file']}' target='_blank'>{$photo['id']}</a></td>";
							echo "<td>{$photo['is_shared']}</td>";
							echo "<td>{$photo['is_followed']}</td>";
							echo "<td>{$photo['upload_time']}</td>";
							echo "<td><a href='http://api.t.sina.com.cn/{$photo['wb_uid']}/statuses/{$photo['post_id']}' target='_blank'>{$photo['share_time']}</a></td>";
							echo '</tr>';
						}
						?>
                    </tbody>
                </table>
            </div>
        </div>
        <?php if (isset($data['pages'])) : ?>
            <div class="row">
                <div class="pagination pull-right">
                    <ul>
                        <li><a href="?page=<?php echo $data['page_prev']; ?>">Prev</a></li>
                        <?php for ($i=1; $i<=$data['pages']; $i++) : ?>
                            <li<?php if ($data['page_current'] == $i) echo ' class="active"'; ?>><a href="?page=<?php echo $i; ?>"><?php echo $i; ?></a></li>
                        <?php endfor; ?>
                        <li><a href="?page=<?php echo $data['page_next']; ?>">Next</a></li>
                    </ul>
                </div>
            </div>
        <?php endif; ?>
    </div>
  </body>
</html>